package day07;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class HomeWork {
    public static void main(String[] args) {
        int[] a = num(4);
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i]);

            //猜字小游戏
            /*Scanner scan=new Scanner(System.in);
            Random rand=new Random();
            int numm= rand.nextInt(500);
            System.out.println(numm);
            while (true){
                System.out.println("猜吧！");
                int guess=scan.nextInt();
                if (guess>numm){
                    System.out.println("big");
                }else if (guess<numm){
                    System.out.println("small");
                }else {
                    System.out.println("OK");
                    break;
                }
            }

             */

        }
    }

    //生成随机验证码
    public static int[] num(int len) {
        Random rand = new Random();
        int[] a = new int[len];
        for (int i = 0; i < a.length; i++) {
            int index = rand.nextInt(9);
            a[i] = index;
        }
        return a;
    }

}

